{% load static %}
<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Roguelike Game</title>
    <link rel="stylesheet" href="{% static 'css/style.css' %}">
    <style>
        body {
            margin: 0;
            padding: 0;
            font-family: Arial, sans-serif;
        }

        header {
            background-color: #333;
            padding: 1rem;
        }

        header nav {
            text-align: right;
        }

        header nav a {
            color: white;
            text-decoration: none;
            margin-left: 20px;
        }

        main {
            min-height: calc(100vh - 200px);
        }

        .login-container {
            max-width: 400px;
            margin: 50px auto;
            padding: 20px;
            border: 1px solid #ddd;
            border-radius: 5px;
            box-shadow: 0 0 10px rgba(0,0,0,0.1);
        }

        .login-container h2 {
            text-align: center;
            color: #333;
            margin-bottom: 20px;
        }

        .login-container form p {
            margin-bottom: 15px;
        }

        .login-container form label {
            display: block;
            margin-bottom: 5px;
            color: #666;
        }

        .login-container form input {
            width: 100%;
            padding: 8px;
            border: 1px solid #ddd;
            border-radius: 4px;
            box-sizing: border-box;
        }

        footer {
            background-color: #333;
            color: white;
            text-align: center;
            padding: 1rem;
            position: relative;
            bottom: 0;
            width: 100%;
        }

        .messages {
            padding: 10px;
            margin: 10px 0;
        }

        .message {
            padding: 10px;
            margin: 5px 0;
            border-radius: 4px;
        }

        .message.success {
            background-color: #d4edda;
            color: #155724;
        }

        .message.error {
            background-color: #f8d7da;
            color: #721c24;
        }
    </style>
</head>
<body>
    <header>
        <nav>
            {% if user.is_authenticated %}
                <a href="{% url 'game_core:home' %}">首页</a>
                <a href="{% url 'accounts:profile' %}">个人资料</a>
                <a href="{% url 'accounts:logout' %}">登出</a>
            {% else %}
                <a href="{% url 'accounts:login' %}">登录</a>
                <a href="{% url 'accounts:register' %}">注册</a>
            {% endif %}
        </nav>
    </header>

    <main>
        {% if messages %}
            <div class="messages">
                {% for message in messages %}
                    <div class="message {{ message.tags }}">
                        {{ message }}
                    </div>
                {% endfor %}
            </div>
        {% endif %}

        {% block content %}
        {% endblock %}
    </main>

    <footer>
        <p>&copy; 2024 Roguelike Game. All rights reserved.</p>
    </footer>
</body>
</html> 